package com.management.department.teacherinfosystem.Entity;

import java.util.Date;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.PrePersist;
import jakarta.persistence.Table;
import jakarta.persistence.Temporal;
import jakarta.persistence.TemporalType;
import lombok.Data;

@Data
@Entity
@Table(name = "party_activity_attendance")
public class PartyActivityAttendance {
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;

	@Column(name = "activity_id", nullable = false)
	private Long activityId;

	@Column(name = "user_id", nullable = false)
	private Long userId;

	@Column(name = "attendance_status", nullable = false)
	private String attendanceStatus; // 出席/缺席/请假

	@Column(name = "role")
	private String role; // 担任角色：主讲/发言等（可选）

	@Column(name = "reason")
	private String reason;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "created_at")
	private Date createdAt;

	@PrePersist
	public void prePersist() {
		if (createdAt == null) createdAt = new Date();
	}
} 